{% extends 'BWLwebshopBundle:Admin:base.html.twig' %}

{% block body %}



    <h1> Primärbedarfsanalyse</h1>
    <article class="box">
        <h2>Bitte wähle ein Alpha</h2>

        <form action="{{ path('bwl_webshop_primaryRequirements') }}"
              method="post" {{ form_enctype(form) }}>
            {{ form_errors(form) }}
            {{ form_row(form.factor, { 'attr': {'class': 'itext'} }) }}
            {{ form_rest(form) }}
            <input type="submit"/>
        </form>
    </article>
    <br \>

    {% for name,component in  components %}
        <article class="box">

            <h1>{{ name }}</h1>
            <table class="dottedlightsmall">
                <tr>
                    <th>Monat</th>
                    <th>Bedarf</th>
                    <th>Mittel</th>
                    <th>Primärbedarf</th>
                </tr>
                {% for month, prop in component %}
                    <tr>
                        <td>{{ month }}</td>
                        <td>  {{ prop.requirement }}</td>
                        <td> {{ prop.average|number_format(2, ',', '.') }}</td>
                        <td>{{ prop.primaryRequirement|number_format(2, ',', '.') }}</td>
                    </tr>
                {% endfor %}
            </table>
        </article>
    {% endfor %}




{% endblock %}